package com.orangeforms.webadmin.config;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 * @Author：howlrou
 * @Date：2024/8/13 17:26
 */

@Configuration
public class WebConfig implements WebMvcConfigurer {

    @Autowired
    ApplicationConfig applicationConfig;

    @Override
    public void addResourceHandlers(ResourceHandlerRegistry registry) {
        // 将 /app/** 映射到 D:/workspace/OrangeFormsOpen-MybatisPlus/zz-resource/upload-files/app/ 目录
        registry.addResourceHandler(applicationConfig.getAddResourceHandler())
                .addResourceLocations(applicationConfig.getAddResourceLocations());
    }
}
